package com.intelligent.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.intelligent.entity.Permission;
import com.intelligent.mapper.PermissionMapper;
import com.intelligent.service.PermissionRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PermissionRuleServiceImpl implements PermissionRuleService {

    @Autowired
    private PermissionMapper permissionMapper;

    @Override
    public List<Permission> getApiRules() {
        return permissionMapper.selectList(new LambdaQueryWrapper<Permission>()
                .isNotNull(Permission::getPath)
                .ne(Permission::getPath, "")
                .isNotNull(Permission::getType)
                .ne(Permission::getType, ""));
    }
}
